/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package proyecto.modelo;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author sistemas
 */
@Entity
@Table(name = "inv_ingresodet")
@NamedQueries({
    @NamedQuery(name = "InvIngresodet.findAll", query = "SELECT i FROM InvIngresodet i"),
    @NamedQuery(name = "InvIngresodet.findByIngdingresoDetId", query = "SELECT i FROM InvIngresodet i WHERE i.invIngresodetPK.ingdingresoDetId = :ingdingresoDetId"),
    @NamedQuery(name = "InvIngresodet.findByInvingresoingingresoId", query = "SELECT i FROM InvIngresodet i WHERE i.invIngresodetPK.invingresoingingresoId = :invingresoingingresoId"),
    @NamedQuery(name = "InvIngresodet.findByIngdarticuloId", query = "SELECT i FROM InvIngresodet i WHERE i.ingdarticuloId = :ingdarticuloId"),
    @NamedQuery(name = "InvIngresodet.findByIngdCantidad", query = "SELECT i FROM InvIngresodet i WHERE i.ingdCantidad = :ingdCantidad")})
public class InvIngresodet implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected InvIngresodetPK invIngresodetPK;
    @Column(name = "ingd_articuloId")
    private Integer ingdarticuloId;
    @Column(name = "ingd_cantidad")
    private Integer ingdCantidad;

    public InvIngresodet() {
    }

    public InvIngresodet(InvIngresodetPK invIngresodetPK) {
        this.invIngresodetPK = invIngresodetPK;
    }

    public InvIngresodet(int ingdingresoDetId, int invingresoingingresoId) {
        this.invIngresodetPK = new InvIngresodetPK(ingdingresoDetId, invingresoingingresoId);
    }

    public InvIngresodetPK getInvIngresodetPK() {
        return invIngresodetPK;
    }

    public void setInvIngresodetPK(InvIngresodetPK invIngresodetPK) {
        this.invIngresodetPK = invIngresodetPK;
    }

    public Integer getIngdarticuloId() {
        return ingdarticuloId;
    }

    public void setIngdarticuloId(Integer ingdarticuloId) {
        this.ingdarticuloId = ingdarticuloId;
    }

    public Integer getIngdCantidad() {
        return ingdCantidad;
    }

    public void setIngdCantidad(Integer ingdCantidad) {
        this.ingdCantidad = ingdCantidad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (invIngresodetPK != null ? invIngresodetPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InvIngresodet)) {
            return false;
        }
        InvIngresodet other = (InvIngresodet) object;
        if ((this.invIngresodetPK == null && other.invIngresodetPK != null) || (this.invIngresodetPK != null && !this.invIngresodetPK.equals(other.invIngresodetPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "proyecto.modelo.InvIngresodet[invIngresodetPK=" + invIngresodetPK + "]";
    }

}
